package com.yfux.cling_player.nums;

import org.fourthline.cling.support.model.TransportState;

public enum RenderState {
    IDLE,
    PREPARING,
    PLAYING,
    PAUSED,
    STOPPED,
    ERROR;

    public TransportState toTransportState() {
        switch (this) {
            case PLAYING:
            case PREPARING:
                return TransportState.PLAYING;
            case PAUSED:
                return TransportState.PAUSED_PLAYBACK;
            case STOPPED:
            case ERROR:
                return TransportState.STOPPED;
            default:
                return TransportState.NO_MEDIA_PRESENT;
        }
    }
}